<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Box2D: b2DistanceJointDef Struct Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="icon.gif"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Box2D
   &#160;<span id="projectnumber">2.2.1</span>
   </div>
   <div id="projectbrief">A 2D Physics Engine for Games</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a>  </div>
  <div class="headertitle">
<div class="title">b2DistanceJointDef Struct Reference</div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="b2DistanceJointDef" --><!-- doxytag: inherits="b2JointDef" -->
<p><code>#include &lt;<a class="el" href="b2_distance_joint_8h_source.html">b2DistanceJoint.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for b2DistanceJointDef:</div>
<div class="dyncontent">
 <div class="center">
  <img src="structb2_distance_joint_def.png" usemap="#b2DistanceJointDef_map" alt=""/>
  <map id="b2DistanceJointDef_map" name="b2DistanceJointDef_map">
<area href="structb2_joint_def.html" title="Joint definitions are used to construct joints." alt="b2JointDef" shape="rect" coords="0,0,122,24"/>
</map>
 </div></div>

<p><a href="structb2_distance_joint_def-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structb2_distance_joint_def.html#a99788a534638cc28cd1e44e0036503f0">Initialize</a> (<a class="el" href="classb2_body.html">b2Body</a> *<a class="el" href="structb2_joint_def.html#a8cd54c93da396be75a9788f2c6897f05">bodyA</a>, <a class="el" href="classb2_body.html">b2Body</a> *<a class="el" href="structb2_joint_def.html#aa4f4dee2fbcd12187b19506b60e68e3d">bodyB</a>, const <a class="el" href="structb2_vec2.html">b2Vec2</a> &amp;anchorA, const <a class="el" href="structb2_vec2.html">b2Vec2</a> &amp;anchorB)</td></tr>
<tr><td colspan="2"><h2><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a15c7a75fa277e2056bf1b44198658518"></a><!-- doxytag: member="b2DistanceJointDef::localAnchorA" ref="a15c7a75fa277e2056bf1b44198658518" args="" -->
<a class="el" href="structb2_vec2.html">b2Vec2</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structb2_distance_joint_def.html#a15c7a75fa277e2056bf1b44198658518">localAnchorA</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The local anchor point relative to bodyA's origin. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3c8995be726238eee084af750442255c"></a><!-- doxytag: member="b2DistanceJointDef::localAnchorB" ref="a3c8995be726238eee084af750442255c" args="" -->
<a class="el" href="structb2_vec2.html">b2Vec2</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structb2_distance_joint_def.html#a3c8995be726238eee084af750442255c">localAnchorB</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The local anchor point relative to bodyB's origin. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac2c48ad52de91c804c386c12c5bf3714"></a><!-- doxytag: member="b2DistanceJointDef::length" ref="ac2c48ad52de91c804c386c12c5bf3714" args="" -->
float32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structb2_distance_joint_def.html#ac2c48ad52de91c804c386c12c5bf3714">length</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The natural length between the anchor points. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">float32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structb2_distance_joint_def.html#a35e2362bcb6c58734f95d0ac045863ea">frequencyHz</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad009b24ff211158eb4e1db4815a63b94"></a><!-- doxytag: member="b2DistanceJointDef::dampingRatio" ref="ad009b24ff211158eb4e1db4815a63b94" args="" -->
float32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structb2_distance_joint_def.html#ad009b24ff211158eb4e1db4815a63b94">dampingRatio</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The damping ratio. 0 = no damping, 1 = critical damping. <br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Distance joint definition. This requires defining an anchor point on both bodies and the non-zero length of the distance joint. The definition uses local anchor points so that the initial configuration can violate the constraint slightly. This helps when saving and loading a game. </p>
<dl class="warning"><dt><b>Warning:</b></dt><dd>Do not use a zero or short length. </dd></dl>
</div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a99788a534638cc28cd1e44e0036503f0"></a><!-- doxytag: member="b2DistanceJointDef::Initialize" ref="a99788a534638cc28cd1e44e0036503f0" args="(b2Body *bodyA, b2Body *bodyB, const b2Vec2 &amp;anchorA, const b2Vec2 &amp;anchorB)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void b2DistanceJointDef::Initialize </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classb2_body.html">b2Body</a> *&#160;</td>
          <td class="paramname"><em>bodyA</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classb2_body.html">b2Body</a> *&#160;</td>
          <td class="paramname"><em>bodyB</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structb2_vec2.html">b2Vec2</a> &amp;&#160;</td>
          <td class="paramname"><em>anchorA</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structb2_vec2.html">b2Vec2</a> &amp;&#160;</td>
          <td class="paramname"><em>anchorB</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Initialize the bodies, anchors, and length using the world anchors. </p>

</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="a35e2362bcb6c58734f95d0ac045863ea"></a><!-- doxytag: member="b2DistanceJointDef::frequencyHz" ref="a35e2362bcb6c58734f95d0ac045863ea" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float32 <a class="el" href="structb2_distance_joint_def.html#a35e2362bcb6c58734f95d0ac045863ea">b2DistanceJointDef::frequencyHz</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>The mass-spring-damper frequency in Hertz. A value of 0 disables softness. </p>

</div>
</div>
<hr/>The documentation for this struct was generated from the following files:<ul>
<li><a class="el" href="b2_distance_joint_8h_source.html">b2DistanceJoint.h</a></li>
<li>b2DistanceJoint.cpp</li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Sat Sep 17 2011 17:35:55 for Box2D by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
